<?php

class ShowCalcNumber extends ShowCalc {
    function write() {
        $txt =  "<form action='".$_SERVER['PHP_SELF']."' method='post' id='number-area'>";
        for ($i = 0; $i <= 9; $i++) {
            $txt .= <<<TXT
              <button type="submit" name="numb" value="{$i}">{$i}</button>
TXT;
        }
        $txt .= "</form>";
        return $txt;
    }

    function showInput($data) {
        $txt = "<input type='text' value='{$data}'/>";
        return $txt;
    }

    function calcArea($data) {
        echo "<div id='calc'>";
        foreach ($data as $v) {
            echo $v;
        }
        echo "</div>";
    }
}